<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8" />
	<title></title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″/>
	<link rel="stylesheet" type="text/css" href="../../css/defaultcss.css" />
	<link rel="stylesheet" type="text/css" href="../../css/amazeui.min.css" />
	<script type="text/javascript" src="../../js/jquery-1.9.1.min.js"></script>
	<script src='../../js/amazeui.min.js'></script>
	<script src='../../js/flex.js'></script>
	<script src='../../js/index.js'></script>
	<script type="text/javascript" src="../../layer/layer.js"></script>
	<link rel="stylesheet" href="../../css/weui.min.css">
	<link rel="stylesheet" href="../../css/css/stylesheets/index.css">

</head>

<body>
	<header>
		<div class="goBack">
			<img src="../../img/base/back.png" alt="返回">
		</div>
		<span class="title"> 案件信息 </span>
	</header>
	<div class="content  case_detail">
		<div class="title">
			基本信息
		</div>
		<div class="detail_box">
			<ul class="detail_ul">
				<li>
					<div class="li_label">
						案件名称
					</div>
					<div class="li_detail" id="caseName">
					</div>
				</li>
				<li>
					<div class="li_label">
						当事人名字
					</div>
					<div class="li_detail" id="party">
					</div>
				</li>
				<li>
					<div class="li_label">
						案件类型
					</div>
					<div class="li_detail" id="caseType">
					</div>
				</li>
				<li>
					<div class="li_label">
						承办人员
					</div>
					<div class="li_detail" id="contractor">
					</div>
				</li>
				<li>
					<div class="li_label">
						承办单位
					</div>
					<div class="li_detail" id="contractorUnit">
					</div>
				</li>
				<li>
					<div class="li_label">
						受理时间
					</div>
					<div class="li_detail" id="acceptDate">
					</div>
				</li>
				<li>
					<div class="li_label">
						案件状态
					</div>
					<div class="li_detail" id="caseState">
						二审
					</div>
				</li>
				<div class="li_title1">
					案件详情
				</div>
				<div class="detail" id="content">
				</div>
				<div class="li_title1">
					审查意见
				</div>
				<div class="detail" id="remarks">
				</div>
			</ul>
		</div>
		<div class=" application_enquiry apply_table">
			<div class="apply_title">
				申请表
			</div>
			<div id="fform">
				<ul class="form_ul">
					<li>
						<label for="">申请人</label>
						<div id="applyName">
						</div>
					</li>
					<li class="type">
						<label for="contractType">申请操作</label>
						<div id="type">
						</div>
					</li>
					<li>
						<label for="">承办人</label>
						<div id="undertaker">
						</div>
					</li>

					<li class="result_li">
						<label for="">申请结果</label>
						<div id="result">
						</div>
					</li>
				</ul>
				<div class="booking_tips">
					申请审核中，请耐心等待...
				</div>
				<div class="submitBtn result_li">
					<button class="button" type="button">
						<a href="javascript:void(0)">评价</a>
					</button>
				</div>
			</div>
		</div>
	</div>
</body>

</html>

<script type="text/javascript ">
	$('.goBack').bind('click', function () {
		window.history.back()
	})
	var star_level = 0;
	var caseId, evaluation;
	var getData = function (id) {
		HYIP.ajax({
			url: '/lawyerCase/bookingInfo.action',
			type: 'get',
			data: {
				id: id
			}
		}, function (data) {
			//律师案件信息
			var lawyerCase = data.data.data.lawyerCase;
			$('#caseName').text(lawyerCase.caseName);
			$('#party').text(lawyerCase.party);
			$('#caseType').text(lawyerCase.caseType);
			$('#contractor').text(lawyerCase.contractor);
			$('#contractorUnit').text(lawyerCase.contractorUnit);
			$('#acceptDate').text(lawyerCase.acceptDate);
			var caseState;
			switch (parseInt(lawyerCase.state)) {
				case 1:
					caseState = "审理中";
					break;
				case 2:
					caseState = "一审";
					break;
				case 3:
					caseState = "二审";
					break;
				case 4:
					caseState = "结案";
					break;
			}
			$("#caseState").text(caseState)
			$('#content').text(lawyerCase.content);
			$('#remarks').text(lawyerCase.remarks);
			//案件预约信息
			var caseBooking = data.data.data.caseBooking;
			$('#applyName').text(caseBooking.applyName);
			$('#undertaker').text(caseBooking.undertaker);
			//状态 NEW("0","预约中"),ALLOW("1","允许"),REFUSE("2","拒绝");
			console.log(caseBooking.state)
			if (parseInt(caseBooking.state) == 0) {
				$(".result_li").hide();
				$(".booking_tips").show();
			} else {
				$(".result_li").show();
				$(".booking_tips").hide();
			}
			var type;
			switch (parseInt(caseBooking.type)) {
				case 1:
					type = "申请阅卷";
					break;
				case 2:
					type = "申请会见";
					break;
				case 3:
					type = "申请收集（调取）证据材料";
					break;
				case 4:
					type = "申请自行收取证据材料";
					break;
				case 5:
					type = "申请变更（解除）强制措施";
					break;
				case 6:
					type = "提供证据材料";
					break;
				case 7:
					type = "要求听取意见";
					break;
				case 8:
					type = "其他";
					break;
			}
			$('#type').text(type);
			$('#result').text(caseBooking.result);
			star_level = caseBooking.starLevel;
			bookingId = caseBooking.id;
			evaluation = caseBooking.evaluation;
		});
	}
	$(".submitBtn").bind('click', function () {
		window.location.href = './evaluate.html?star_level=' + star_level + '&bookingId=' + bookingId + '&evaluation=' +
			evaluation;
	})

	function GetRequest() {
		var url = location.search; //获取url中"?"符后的字串
		var theRequest = new Object();
		if (url.indexOf("?") != -1) {
			var str = url.substr(1);
			strs = str.split("&");
			for (var i = 0; i < strs.length; i++) {
				theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
			}
		}
		return theRequest;
	}
	getData(GetRequest()['id'], GetRequest()['state']);
	console.log(GetRequest())
</script>